<style lang="less">
  @import "menu.less";
</style>
<template>
  <ul class="m-menu">
    <slot></slot>
  </ul>
</template>
<script>
    import emitter from '@/mixins/emitter.js'
    export default{
      name: 'PoemMenu',
      mixins: [ emitter ],
      data () {
        return {
          currentActiveName:''
        }
      },
      mounted () {
        /**
         * 监听选中菜单变更事件，并触发菜单选择事件
         */
        this.$on('item-change', function (name) {
            this.currentActiveName = name;
            this.broadcast('PoemSubMenu','item-change',name);
            this.broadcast('PoemMenuItem','item-change',name);
            this.$emit('select-item', name);
        });
      },

    }
</script>
